{% extends 'TopxiaWebBundle:CourseManage:layout.html.twig' %}
{% block title %}{{'课程文件'|trans}} - {{ parent() }}{% endblock %}
{% set side_nav = 'files' %}
{% set tab = 'courseLesson' %}
{% set script_controller = 'course-manage-file/index' %}
{% block main %}
  <style type="text/css">
  .tooltip-inner{
  max-width: 600px;
  }
  </style>
  <div class="panel panel-default panel-col">
    <div class="panel-heading">
      <a class="btn btn-info btn-sm pull-right"
        data-toggle="modal" data-target="#modal"
        data-url="{{path('uploader_batch_uplod', {token:uploader_token('coursematerial', course.id, 'private')}) }}"
      >
        <i class="glyphicon glyphicon-cloud-upload"></i>{{'添加课程文件'|trans}}
      </a>
      {{'课程文件'|trans}}
    </div>
    <div class="panel-body" id="file-manage-panel" data-file-status-url="{{path('course_manage_file_status')}}">
      <table class="table table-striped table-hover" id="course-lesson-table">
        <thead>
          <tr>
            <th width="5%"><input type="checkbox"  data-role="batch-select"></th>
            <th>{{'文件名'|trans}}</th>
            <th>{{'类型'|trans}}</th>
            <th>{{'大小'|trans}}</th>
            <th>{{'使用'|trans}}</th>
            <th>{{'最后更新'|trans}}</th>
          </tr>
        </thead>
        <tbody>

          {% for uploadFile in files if uploadFile %}
            {% include 'TopxiaWebBundle:CourseFileManage:tbody-tr.html.twig' %}
          {% else %}
            <tr class="empty"><td colspan="20">{{'无文件记录'|trans}}</td></tr>
          {% endfor %}
          
        </tbody>
      </table>

      <label class="checkbox-inline mrm mbm"><input type="checkbox" data-role="batch-select"> {{'全选'|trans}}</label>

      <div class="btn-group mbm">
        <button class="btn btn-danger btn-sm" data-role="batch-delete" data-name="{{'文件记录'|trans}}" data-url="{{ path('course_manage_delete_materials_show', {id:course.id, type:tab}) }}">
        <i class="glyphicon glyphicon-trash"></i>
        {{'移除'|trans}}</button>
      </div>

      <nav class="text-center">
        {{ web_macro.paginator(paginator) }}
      </nav>

    </div>
  </div>
{% endblock %}